using System;
using System.Data;
using System.Collections.Generic;
using Soccer.Core;
using Soccer.Utility;

namespace Soccer.Business
{
    [TableAttribute("Users")]
	[Serializable]
    public class User : DBO<User>
    {
		#region Fields
		
		private int? _IdUser;
		private string _UserName;
		private string _Password;
		private string _Email;
		private string _Fullname;
		private DateTime? _Birthdate;
		private string _Phone;
		private int? _IdCountry;
		private string _Province;
		private string _Address;
		private string _Fax;
		private string _Career;
		private string _Avatar;
		private bool? _IsActived;
		private DateTime? _CreatedDate;
		private DateTime? _LastModifiedDate;
		
		#endregion
		
		#region Constructors
		/// <summary>
		/// Default constructor
		/// </summary>
		public User()
		{
			
		}
		
		/// <summary>
		/// Constructor with IdUser 
		/// </summary>
		/// <param name="IdUser">The IdUser</param>
		public User(int? IdUser )
		{
			this.IdUser = IdUser;
		}
		
		/// <summary>
		/// Constructor with all parameters
		/// </summary>
		/// <param name="IdUser">Sets int? value for IdUser</param>
		/// <param name="UserName">Sets string value for UserName</param>
		/// <param name="Password">Sets string value for Password</param>
		/// <param name="Email">Sets string value for Email</param>
		/// <param name="Fullname">Sets string value for Fullname</param>
		/// <param name="Birthdate">Sets DateTime? value for Birthdate</param>
		/// <param name="Phone">Sets string value for Phone</param>
		/// <param name="IdCountry">Sets int? value for IdCountry</param>
		/// <param name="Province">Sets string value for Province</param>
		/// <param name="Address">Sets string value for Address</param>
		/// <param name="Fax">Sets string value for Fax</param>
		/// <param name="Career">Sets string value for Career</param>
		/// <param name="Avatar">Sets string value for Avatar</param>
		/// <param name="IsActived">Sets bool? value for IsActived</param>
		/// <param name="CreatedDate">Sets DateTime? value for CreatedDate</param>
		/// <param name="LastModifiedDate">Sets DateTime? value for LastModifiedDate</param>
		public User(int? idUser, string userName, string password, string email, string fullname, DateTime? birthdate, string phone, int? idCountry, string province, string address, string fax, string career, string avatar, bool? isActived, DateTime? createdDate, DateTime? lastModifiedDate)
		{
			this.IdUser = idUser;
			this.UserName = userName;
			this.Password = password;
			this.Email = email;
			this.Fullname = fullname;
			this.Birthdate = birthdate;
			this.Phone = phone;
			this.IdCountry = idCountry;
			this.Province = province;
			this.Address = address;
			this.Fax = fax;
			this.Career = career;
			this.Avatar = avatar;
			this.IsActived = isActived;
			this.CreatedDate = createdDate;
			this.LastModifiedDate = lastModifiedDate;
		}
		
		#endregion
		
		#region Properties
		
		/// <summary>
		/// Gets or sets int? value for IdUser
		/// </summary>
		[ColumnAttribute("IdUser", SqlDbType.Int , 4 , true, true, false)]
		public int? IdUser
		{
			set
			{
				this._IdUser = value;
			}
			get
			{
				return this._IdUser;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for UserName
		/// </summary>
		[ColumnAttribute("UserName", SqlDbType.NVarChar , 100 , false, false, true)]
		public string UserName
		{
			set
			{
				this._UserName = value;
			}
			get
			{
				return this._UserName;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Password
		/// </summary>
		[ColumnAttribute("Password", SqlDbType.NVarChar , 100 , false, false, true)]
		public string Password
		{
			set
			{
				this._Password = value;
			}
			get
			{
				return this._Password;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Email
		/// </summary>
		[ColumnAttribute("Email", SqlDbType.NVarChar , 100 , false, false, true)]
		public string Email
		{
			set
			{
				this._Email = value;
			}
			get
			{
				return this._Email;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Fullname
		/// </summary>
		[ColumnAttribute("Fullname", SqlDbType.NVarChar , 200 , false, false, true)]
		public string Fullname
		{
			set
			{
				this._Fullname = value;
			}
			get
			{
				return this._Fullname;
			}
		}
		
		/// <summary>
		/// Gets or sets DateTime? value for Birthdate
		/// </summary>
		[ColumnAttribute("Birthdate", SqlDbType.DateTime , 8 , false, false, true)]
		public DateTime? Birthdate
		{
			set
			{
				this._Birthdate = value;
			}
			get
			{
				return this._Birthdate;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Phone
		/// </summary>
		[ColumnAttribute("Phone", SqlDbType.NVarChar , 20 , false, false, true)]
		public string Phone
		{
			set
			{
				this._Phone = value;
			}
			get
			{
				return this._Phone;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for IdCountry
		/// </summary>
		[ColumnAttribute("IdCountry", SqlDbType.Int , 4 , false, false, true)]
		public int? IdCountry
		{
			set
			{
				this._IdCountry = value;
			}
			get
			{
				return this._IdCountry;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Province
		/// </summary>
		[ColumnAttribute("Province", SqlDbType.NVarChar , 100 , false, false, true)]
		public string Province
		{
			set
			{
				this._Province = value;
			}
			get
			{
				return this._Province;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Address
		/// </summary>
		[ColumnAttribute("Address", SqlDbType.NVarChar , 1000 , false, false, true)]
		public string Address
		{
			set
			{
				this._Address = value;
			}
			get
			{
				return this._Address;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Fax
		/// </summary>
		[ColumnAttribute("Fax", SqlDbType.NVarChar , 100 , false, false, true)]
		public string Fax
		{
			set
			{
				this._Fax = value;
			}
			get
			{
				return this._Fax;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Career
		/// </summary>
		[ColumnAttribute("Career", SqlDbType.NVarChar , 200 , false, false, true)]
		public string Career
		{
			set
			{
				this._Career = value;
			}
			get
			{
				return this._Career;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Avatar
		/// </summary>
		[ColumnAttribute("Avatar", SqlDbType.NVarChar , 100 , false, false, true)]
		public string Avatar
		{
			set
			{
				this._Avatar = value;
			}
			get
			{
				return this._Avatar;
			}
		}
		
		/// <summary>
		/// Gets or sets bool? value for IsActived
		/// </summary>
		[ColumnAttribute("IsActived", SqlDbType.Bit , 1 , false, false, true)]
		public bool? IsActived
		{
			set
			{
				this._IsActived = value;
			}
			get
			{
				return this._IsActived;
			}
		}
		
		/// <summary>
		/// Gets or sets DateTime? value for CreatedDate
		/// </summary>
		[ColumnAttribute("CreatedDate", SqlDbType.DateTime , 8 , false, false, true)]
		public DateTime? CreatedDate
		{
			set
			{
				this._CreatedDate = value;
			}
			get
			{
				return this._CreatedDate;
			}
		}
		
		/// <summary>
		/// Gets or sets DateTime? value for LastModifiedDate
		/// </summary>
		[ColumnAttribute("LastModifiedDate", SqlDbType.DateTime , 8 , false, false, true)]
		public DateTime? LastModifiedDate
		{
			set
			{
				this._LastModifiedDate = value;
			}
			get
			{
				return this._LastModifiedDate;
			}
		}
		
		
		/// <summary>
		/// Get a Country of current User object base on IdCountry
		/// </summary>
		public Country Country
		{
			get
			{
				if (this.IdCountry == null)
					return null;
	
				Country condition = new Country(this.IdCountry);
				return CountryController.FindItem(condition);
			}
		}
		
		/// <summary>
		/// Get a list AsianPredict of current User object base on IdUser
		/// </summary>
		public List<AsianPredict> AsianPredictListForIdUser
		{
			get
			{
				if (this.IdUser == null)
					return null;
				AsianPredict condition = new AsianPredict();
				condition.IdUser = this.IdUser;
				return AsianPredictController.FindItems(condition);
			}
		}
		
		/// <summary>
		/// Get a list Comment of current User object base on IdUser
		/// </summary>
		public List<Comment> CommentListForIdUser
		{
			get
			{
				if (this.IdUser == null)
					return null;
				Comment condition = new Comment();
				condition.IdUser = this.IdUser;
				return CommentController.FindItems(condition);
			}
		}
		
		/// <summary>
		/// Get a list EuroPredict of current User object base on IdUser
		/// </summary>
		public List<EuroPredict> EuroPredictListForIdUser
		{
			get
			{
				if (this.IdUser == null)
					return null;
				EuroPredict condition = new EuroPredict();
				condition.IdUser = this.IdUser;
				return EuroPredictController.FindItems(condition);
			}
		}
		
		/// <summary>
		/// Get a list ScorePredict of current User object base on IdUser
		/// </summary>
		public List<ScorePredict> ScorePredictListForIdUser
		{
			get
			{
				if (this.IdUser == null)
					return null;
				ScorePredict condition = new ScorePredict();
				condition.IdUser = this.IdUser;
				return ScorePredictController.FindItems(condition);
			}
		}
		
		/// <summary>
		/// Get a list UnderOverPredict of current User object base on IdUser
		/// </summary>
		public List<UnderOverPredict> UnderOverPredictListForIdUser
		{
			get
			{
				if (this.IdUser == null)
					return null;
				UnderOverPredict condition = new UnderOverPredict();
				condition.IdUser = this.IdUser;
				return UnderOverPredictController.FindItems(condition);
			}
		}
		
		#endregion
        
        #region Other Properties
        private static ColumnNameStruct? _ColumnName;
        public static ColumnNameStruct ColumnName
        {
            get
            {
                if (!_ColumnName.HasValue)
                    _ColumnName = new ColumnNameStruct();
                return _ColumnName.Value;
            }
        }
        #endregion

        #region NestedType
        public  struct ColumnNameStruct
        {
            /// <summary>
            /// Get the name of column [IdUser]
            /// </summary>
            public string IdUser
            {
                get
                {
                    return "IdUser";
                }
            }
            /// <summary>
            /// Get the name of column [UserName]
            /// </summary>
            public string UserName
            {
                get
                {
                    return "UserName";
                }
            }
            /// <summary>
            /// Get the name of column [Password]
            /// </summary>
            public string Password
            {
                get
                {
                    return "Password";
                }
            }
            /// <summary>
            /// Get the name of column [Email]
            /// </summary>
            public string Email
            {
                get
                {
                    return "Email";
                }
            }
            /// <summary>
            /// Get the name of column [Fullname]
            /// </summary>
            public string Fullname
            {
                get
                {
                    return "Fullname";
                }
            }
            /// <summary>
            /// Get the name of column [Birthdate]
            /// </summary>
            public string Birthdate
            {
                get
                {
                    return "Birthdate";
                }
            }
            /// <summary>
            /// Get the name of column [Phone]
            /// </summary>
            public string Phone
            {
                get
                {
                    return "Phone";
                }
            }
            /// <summary>
            /// Get the name of column [IdCountry]
            /// </summary>
            public string IdCountry
            {
                get
                {
                    return "IdCountry";
                }
            }
            /// <summary>
            /// Get the name of column [Province]
            /// </summary>
            public string Province
            {
                get
                {
                    return "Province";
                }
            }
            /// <summary>
            /// Get the name of column [Address]
            /// </summary>
            public string Address
            {
                get
                {
                    return "Address";
                }
            }
            /// <summary>
            /// Get the name of column [Fax]
            /// </summary>
            public string Fax
            {
                get
                {
                    return "Fax";
                }
            }
            /// <summary>
            /// Get the name of column [Career]
            /// </summary>
            public string Career
            {
                get
                {
                    return "Career";
                }
            }
            /// <summary>
            /// Get the name of column [Avatar]
            /// </summary>
            public string Avatar
            {
                get
                {
                    return "Avatar";
                }
            }
            /// <summary>
            /// Get the name of column [IsActived]
            /// </summary>
            public string IsActived
            {
                get
                {
                    return "IsActived";
                }
            }
            /// <summary>
            /// Get the name of column [CreatedDate]
            /// </summary>
            public string CreatedDate
            {
                get
                {
                    return "CreatedDate";
                }
            }
            /// <summary>
            /// Get the name of column [LastModifiedDate]
            /// </summary>
            public string LastModifiedDate
            {
                get
                {
                    return "LastModifiedDate";
                }
            }
        }
        #endregion
    }
}
